import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { BaseItem } from "../common/BaseItem";
import { ExplorerItemInfo } from "../../model/ExplorerItemInfo";
import { ItemData } from "../../resource/info/ItemData";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
//class HitEggShowItemRenderer
    
    export  class HitEggShowItemRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            this._item = new BaseItem();
            this._item.isDragAble = false;
            this._item.isDropAble = false;
            addChild(this._item);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=null;
            super.data = arg1;
            if (!(arg1 == null) && arg1 is ExplorerItemInfo) 
            {
                this._itemInfo = arg1 as ExplorerItemInfo;
                loc1 = new ItemData(arg1.item);
                this._item.itemData = loc1;
                if (this._bg == null && this._itemInfo.valued == 1) 
                {
                    this._bg = ObjCreate.createBg(0, 0, 66, 66, this, ImagesConst.PackItemBg);
                    this._item.setSize(60, 60);
                    this._item.move(3, 3);
                    addChildAt(this._bg, 0);
                }
                else if (this._bg == null) 
                {
                    this._bg = ObjCreate.createBg(0, 0, 36, 36, this, ImagesConst.PackItemBg);
                    this._item.setSize(30, 30);
                    this._item.move(3, 3);
                    addChildAt(this._bg, 0);
                }
            }
            else 
            {
                this._itemData = null;
                this._item.itemData = null;
            }
            return;
        }

        protected /* var */_item: BaseItem;

        protected /* var */_itemData: ItemData;

        protected /* var */_bg: Object /* flash.display.Bitmap */;

        protected /* var */_itemInfo: ExplorerItemInfo;
    }
